﻿using System;
using System.Collections.Generic;

namespace Engine.Rule
{
    public class StatType : AttributeType
    {
        public StatType(string name, string description)
            : base(name, description)
        {
        }

        public StatType()
            : this("", "")
        {
        }
    }

    public class Stat : Attribute<StatType>
    {
        public Stat(StatType statType, int value)
            : base(statType, value)
        {
        }

        public Stat()
            : this(null, 0)
        {
        }
    }

    public class StatTypeGroup : AttributeTypeGroup<StatType>
    {
        private const int STAT_COUNT = 4;
        public StatTypeGroup()
            : base(new StatType[STAT_COUNT])
        {
        }
    }

    public class StatGroup : AttributeGroup<StatType, Stat, StatTypeGroup>
    {
        private const int STAT_LIMIT_MIN = 0;
        private const int STAT_LIMIT_MAX = 10;
        
        public StatGroup(StatTypeGroup statTypes)
            : base(statTypes)
        {
        }

        public override int LimitMin
        {
            get { return STAT_LIMIT_MIN; }
        }

        public override int LimitMax
        {
            get { return STAT_LIMIT_MAX; }
        }

        protected override Stat createAttribute(StatType attributeType, int value)
        {
            return new Stat(attributeType, value);
        }
    }
}
